<template>

  <div>

    <center><h1>扫码支付</h1></center>

 
    <a-form-item v-bind="formItemLayout" label="金额">
      <a-input v-model="money"/>
    </a-form-item>
    
   
    <a-form-item v-bind="tailFormItemLayout">
      <a-button type="primary" html-type="submit" @click="submit">
        生成二维码
      </a-button>
    </a-form-item>


    <a-form-item v-bind="formItemLayout" label="二维码">
    
      <img :src="src" />

    </a-form-item>


   </div>

</template>



<script>

export default {
  data() {
    return {
      money:"1",
      src:"",
      formItemLayout: {
        labelCol: {
          xs: { span: 24 },
          sm: { span: 8 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
      },
      tailFormItemLayout: {
        wrapperCol: {
          xs: {
            span: 24,
            offset: 0,
          },
          sm: {
            span: 16,
            offset: 8,
          },
        },
      },
      dataSource: [
        {
          key: '0',
          name: 'Edward King 0',
          age: '32',
          address: 'London, Park Lane no. 0',
        },
        {
          key: '1',
          name: 'Edward King 1',
          age: '32',
          address: 'London, Park Lane no. 1',
        },
      ],
      columns: [
        {
          title: 'name',
          dataIndex: 'name',
        },
        {
          title: 'age',
          dataIndex: 'age',
        },
        {
          title: 'address',
          dataIndex: 'address',
        },
        {
          title: 'operation',
          dataIndex: 'operation',
          scopedSlots: { customRender: 'operation' },
        },
      ],
    };
  },
  methods: {

    submit:function(){

       this.axios.get('http://localhost:8000/wx_pay/').then((result) =>{
            console.log(result.data);
            console.log(result.data.img);

            this.src = "http://localhost:8000/static/"+result.data
  
  });

    },
    onDelete(key) {
      console.log(this.dataSource[key]);
    }

  },
};
</script>